import { Injectable, LoggerService } from '@nestjs/common';
import { Logger } from 'winston';
import { winstonLogger } from './logger.config';

@Injectable()
export class AppLogger implements LoggerService {
  private readonly logger: Logger = winstonLogger;

  log(message: string) {
    this.logger.info(message);
  }
  // error(message: string, trace?: string) {
  //   this.logger.error(message, { trace });
  // }
  error(info: object) {
    this.logger.error(info);
  }
  warn(message: string) {
    this.logger.warn(message);
  }
  debug(message: string) {
    this.logger.debug(message);
  }
  verbose(message: string) {
    this.logger.verbose(message);
  }
}
